package com.atguigu.srb.core.mapper;

import com.atguigu.srb.core.pojo.entity.ChallengeTable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ChallengeTableMapper extends BaseMapper<ChallengeTable> {


    @Select("SELECT * FROM challenge_table WHERE initiating_club_number =#{id} ANd is_deleted = 0 ")
    List<ChallengeTable> selectByRespondingClubNumber( @Param("id") String communitynumber);

    @Select("SELECT * FROM challenge_table WHERE(responding_club_number = #{id} OR initiating_club_number =#{id}) ANd is_deleted = 0 AND status = '已接受' ")
    List<ChallengeTable> selectByRespondingClubNumber02( @Param("id") String communitynumber);

    @Select("SELECT * FROM challenge_table WHERE responding_club_number = #{id} =#{id} ANd is_deleted = 0 ")
    List<ChallengeTable> selectByRespondingClubNumber03(@Param("id") String communitynumber);
}
